package com.lxy.controller;

import com.lxy.dao.UserDao;
import com.lxy.entity.User;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class UserController {
    private static final UserDao userManagementDao = new UserDao();

    public static ArrayList<User> queryUser(String username) throws SQLException {
        return userManagementDao.queryUser(username);
    }

    public static Integer updateUser(String username, String property, String value) throws SQLException {
        return userManagementDao.updateUser(username, property, value);
    }

    public static Integer deleteUser(String username) throws SQLException {
        return userManagementDao.deleteUser(username);
    }

    public static Integer insertUser(User user) throws SQLException {
        return userManagementDao.insertUser(user);
    }

    public static List<User> queryAllUsers() {
        return userManagementDao.queryAllUsers();
    }
}